// 全局初始化数据配置，用于 Layout 用户信息和权限初始化
// 更多信息见文档：https://umijs.org/docs/api/runtime-config#getinitialstate
export async function getInitialState(): Promise<{ name: string }> {
  return { name: '@umijs/max' };
}

export const qiankun = {
  apps: window?.__qiankun__?.apps ?? [
    {
      name: 'umi-micro-app',
      entry: '//localhost:8001',
    },
    {
      name: 'webpack-micro-app',
      entry: '//localhost:8002',
    },
    {
      name: 'ice-micro-app',
      entry: '//localhost:8003',
    },
    {
      name: 'vite-micro-app',
      entry: '//localhost:8004',
    },
  ],
  routes: window?.__qiankun__?.routes ?? [
    {
      path: '/umi-micro-app',
      microApp: 'umi-micro-app',
    },
    {
      path: '/webpack-micro-app',
      microApp: 'webpack-micro-app',
    },
    {
      path: '/ice-micro-app',
      microApp: 'ice-micro-app',
    },
    {
      path: '/vite-micro-app',
      microApp: 'vite-micro-app',
    }
  ]
};